angular.module('mamApp').factory('TranscodingManager', ['$http', 'api', 'paramsManager', function ($http, api, paramsManager) {
    var TranscodingManager = {

        /**
         * 转码专辑列表
         * @param params query
         * @returns
         */

        transcodingAlbums: function (params,query) {
            return $http.get(api+'/admin/play/transcoding/albums/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 专辑下面的节目的转码信息
         * @param albumId
         * @param params
         * @param query
         * @returns {*|IPromise<TResult>|IPromiseLike<TResult>|IThenjsProto}
         */
        transcodingPrograms: function (albumId,params,query) {
            return $http.get(api+'/admin/play/transcoding/'+albumId+'/programs/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 节目下面的音频列表
         * @param programId
         * @returns {IPromise<TResult>|*|IPromiseLike<TResult>|IThenjsProto}
         */
        transcodingProgramsAudioList: function (programId) {
            return $http.get(api+'/admin/play/audio/'+programId).then(function (result) {
                return result;
            });
        },
        /**
         * 重新转码
         */
        audioReconvert: function (params) {
            return $http.put(api+'/admin/play/audio/reconvert',params).then(function (result) {
                return result;
            });
        },
        /**
         * 图片重新转码
         * @param params
         * @returns {*}
         */
        imageReconvert:function (params) {
            return $http.post(api+'/open/thumbnail',params).then(function (result) {
                return result;
            });
        }


    };

    return TranscodingManager;
}]);

